//
//  ZYXStudyHeaderView.m
//  RuiBeiKang
//
//  Created by iOS开发1 on 2019/2/11.
//  Copyright © 2019年 JW. All rights reserved.
//

#import "ZYXStudyHeaderView.h"

@implementation ZYXStudyHeaderView
-(void)awakeFromNib{
    [super awakeFromNib];

}
-(void)setModel:(ZYXStudyModel *)model{
    _model = model;
    self.titleLabel.text = model.title;
    
    self.timeLabel.text = model.create_time;
    
    NSMutableString *str1 = [NSMutableString string];
    NSString *w = @"<head><style>img{width:100% !important;}</style></head>";
    [str1 appendString:w];
    [str1 appendString:model.content ? :@""];
    NSMutableAttributedString *htmlStr1 = [[NSMutableAttributedString alloc] initWithData:[str1 dataUsingEncoding:NSUnicodeStringEncoding] options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:nil];
    [htmlStr1 addAttribute:NSFontAttributeName value:R_Font(14) range:NSMakeRange(0, htmlStr1.length)];
    [htmlStr1 addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHexString:@"#666666"] range:NSMakeRange(0, htmlStr1.length)];
    self.contentLabel.attributedText = htmlStr1;
  
    
}

@end
